package method3;

/**
 * 饿汉式，线程安全
 * 缺点：加载class时就初始化，浪费内存
 */
public class Singleton {

	private static Singleton instance = new Singleton();
	
	private Singleton(){}

	public static Singleton getInstance(){
		return instance;
	}
}
